package DB.dto;

import personal.Person;

import java.io.Serializable;

public class PatientDto extends PersonDto implements Serializable
{
	/** 
	 * This attribute maps to the column ID_PATIENT in the PATIENT table.
	 */
	protected int idPatient;
	/**
	 * This attribute represents whether the primitive attribute idPrescription is null.
	 */
	protected boolean idPrescriptionNull = true;

	/** 
	 * This attribute maps to the column ID_NURSE in the PATIENT table.
	 */
	protected int idNurse;

	/** 
	 * This attribute represents whether the primitive attribute idDoctor is null.
	 */
	protected boolean idNurseNull = true;

	/** 
	 * This attribute maps to the column ID_DOCTOR in the PATIENT table.
	 */
	protected int idDoctor;
    

	/** 
	 * This attribute maps to the column ILLNESSHISTORY in the PATIENT table.
	 */
	protected String illnesshistory;

	/**
	 * Method 'PatientDto'
	 * 
	 */
	public PatientDto(PersonDto dto)
	{
        super.setIdPerson(dto.getIdPerson());
        super.setLogin(dto.getLogin());
        super.setName(dto.getName());
        super.setPassword(dto.getPassword());
	}

	/**
	 * Method 'getIdPatient'
	 * 
	 * @return int
	 */
	public int getIdPatient()
	{
		return idPatient;
	}

	/**
	 * Method 'setIdPatient'
	 * 
	 * @param idPatient
	 */
	public void setIdPatient(int idPatient)
	{
		this.idPatient = idPatient;
	}
	/**
	 * Method 'setIdPrescriptionNull'
	 * 
	 * @param value
	 */
	public void setIdPrescriptionNull(boolean value)
	{
		this.idPrescriptionNull = value;
	}

	/**
	 * Method 'isIdPrescriptionNull'
	 * 
	 * @return boolean
	 */
	public boolean isIdPrescriptionNull()
	{
		return idPrescriptionNull;
	}

	/**
	 * Method 'getIdDoctor'
	 * 
	 * @return int
	 */
	public int getIdNurse()
	{
		return idNurse;
	}

	/**
	 * Method 'setIdDoctor'
	 * 
	 * @param idNurse
	 */
	public void setIdNurse(int idNurse)
	{
		this.idNurse = idNurse;
		this.idNurseNull = false;
	}

	/**
	 * Method 'setIdNurseNull'
	 * 
	 * @param value
	 */
	public void setIdNurseNull(boolean value)
	{
		this.idNurseNull = value;
	}

	/**
	 * Method 'isIdNurseNull'
	 * 
	 * @return boolean
	 */
	public boolean isIdNurseNull()
	{
		return idNurseNull;
	}

	/**
	 * Method 'getIdDoctor'
	 * 
	 * @return int
	 */
	public int getIdDoctor()
	{
		return idDoctor;
	}

	/**
	 * Method 'setIdDoctor'
	 * 
	 * @param idDoctor
	 */
	public void setIdDoctor(int idDoctor)
	{
		this.idDoctor = idDoctor;
	}

	/**
	 * Method 'getIllnesshistory'
	 * 
	 * @return String
	 */
	public String getIllnesshistory()
	{
		return illnesshistory;
	}

	/**
	 * Method 'setIllnesshistory'
	 * 
	 * @param illnesshistory
	 */
	public void setIllnesshistory(String illnesshistory)
	{
		this.illnesshistory = illnesshistory;
	}

	/**
	 * Method 'equals'
	 * 
	 * @param _other
	 * @return boolean
	 */
	public boolean equals(Object _other)
	{
		if(_other instanceof Person)
            return ((Person)_other).getIdPerson()==this.getIdPerson();
		else
            return false;
	}

	/**
	 * Method 'hashCode'
	 * 
	 * @return int
	 */
	public int hashCode()
	{
		int _hashCode = 0;
		_hashCode = 29 * _hashCode + idPatient;
		_hashCode = 29 * _hashCode + (idPrescriptionNull ? 1 : 0);
		_hashCode = 29 * _hashCode + idNurse;
		_hashCode = 29 * _hashCode + (idNurseNull ? 1 : 0);
		_hashCode = 29 * _hashCode + idDoctor;
		if (illnesshistory != null) {
			_hashCode = 29 * _hashCode + illnesshistory.hashCode();
		}
		
		return _hashCode;
	}

	/**
	 * Method 'toString'
	 * 
	 * @return String
	 */
	public String toString()
	{
		StringBuffer ret = new StringBuffer();
		ret.append( "DB.dto.PatientDto: " );
		ret.append( "idPatient=" + idPatient );
		ret.append( ", idDoctor=" + idNurse );
		ret.append( ", idDoctor=" + idDoctor );
		ret.append( ", illnesshistory=" + illnesshistory );
		return ret.toString();
	}

}
